package com.dlq.cloud.fallback;

import com.dlq.cloud.pojo.User;
import com.dlq.cloud.service.LoginClientService;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class LoginClientServiceFallBackFactory implements FallbackFactory {


    @Override
    public Object create(Throwable throwable) {
        return new LoginClientService() {
            @Override
            public User getUserByName(String userName) {
                return new User().setId("-1").setLoginName(userName+"暂时不能使用");
            }
        };
    }
}
